﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;


/***
*机器名：BDXYIT-HUI
*项目名称：$projectname$
*命名空间：bdxyit.com.RecruitmentAppSys.Models
*文件名：UserInfoModels
*系统时间：3/25/2012 3:39:19 PM
*当前用户：huihui
*创建时间：2012
*
*修改时间：2012 3/25/2012 3:39:19 PM
*修改事件：
***/

namespace bdxyit.com.RecruitmentAppSys.Models
{
    public class UserInfo
    {

        [Required(ErrorMessage = "身份证号不能为空！")]
        [RegularExpression(@"(^\d{15}$)|(^\d{17}([0-9]|X)$)", ErrorMessage = "身份证输入错误！")]
        [StringLength(18)]
        public string UserID { get; set; }

        [Required(ErrorMessage = "姓名不能为空！")]
        [StringLength(50)]
        public string UserName { get; set; }

        [Required(ErrorMessage = "姓名拼音不能为空！")]
        [RegularExpression(@"(^[A-Za-z]+$)", ErrorMessage = "请输入拼音！")]
        [StringLength(50)]
        public string UserName2 { get; set; }
        
        [StringLength(10)]
        public string Sex { get; set; }

        [Required(ErrorMessage = "籍贯不能为空！")]
        [StringLength(100)]
        public string Hometown { get; set; }

        public string EthnicID { get; set; }

        public string PoliticalID { get; set; }

        [Required(ErrorMessage = "身高不能为空！")]
        [Range(100,300,ErrorMessage="请正确填写身高！")]
        [RegularExpression(@"(^[0-9]*$)", ErrorMessage = "请输入数字！")]
        [StringLength(3)]
        public string Height { get; set; }

        [Required(ErrorMessage = "体重不能为空！")]
        [Range(30,200,ErrorMessage="请正确填写体重！")]
        [RegularExpression(@"(^[0-9]*$)", ErrorMessage = "请输入数字！")]
        [StringLength(3)]
        public string Weight { get; set; }

        public string LeftVisionID { get; set; }

        public string RightVisionID { get; set; }

        [StringLength(10)]
        public string Marital { get; set; }

        [Required(ErrorMessage = "出生日期不能为空！")]
        [StringLength(20)]
        public string Birthday { get; set; }

        [Required(ErrorMessage = "参加工作时间不能为空！")]
        public DateTime StartWorkTime { get; set; }

        [Required(ErrorMessage = "现工作单位不能为空！")]
        [StringLength(50)]
        public string Job { get; set; }

        [Required(ErrorMessage = "部门及职务不能为空！")]
        [StringLength(100)]
        public string SectorPosts { get; set; }

        [Required(ErrorMessage = "户口所在地不能为空！")]
        [StringLength(50)]
        public string Location { get; set; }

        [Required(ErrorMessage = "人事档案现存机构不能为空！")]
        [StringLength(100)]
        public string PersonnelFiles { get; set; }

        [Required(ErrorMessage = "电话号码不能为空！")]
        [DataType(DataType.PhoneNumber, ErrorMessage = "电话号码格式错误！")]
        [StringLength(20)]
        public string PhoneNumber { get; set; }

        [Required(ErrorMessage = "电子邮件不能为空！")]
        [RegularExpression(@"(^[\w-]+@([\w-]+\.)+[\w-]+)", ErrorMessage = "电子邮件格式错误！")]
        [StringLength(50)]
        public string Email { get; set; }

        [Required(ErrorMessage = "通讯地址不能为空！")]
        [StringLength(100)]
        public string Address { get; set; }

        [Required(ErrorMessage = "邮政编码不能为空！")]
        [RegularExpression(@"(^[1-9][0-9]{5}$)", ErrorMessage = "邮政编码输入错误！")]
        [StringLength(6)]
        public string PostalCode { get; set; }

        [StringLength(200)]
        public string Training { get; set; }

        [StringLength(200)]
        public string Performance { get; set; }

        public string PhotoAddress { get; set; }

        [StringLength(200)]
        public string Other { get; set; }
    }
}